package org.qsoft.util;

import java.math.BigDecimal;
import java.math.BigInteger;

import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.converters.*;

public abstract class ConvertUtil { 
	
	public static void initBeanUtilsConvertUtils(){
		//Number
		ConvertUtils.register(new IntegerConverter(null), Integer.class);
		ConvertUtils.register(new FloatConverter(null), Float.class);
		ConvertUtils.register(new LongConverter(null), Long.class);
		ConvertUtils.register(new DoubleConverter(null), Double.class);
		ConvertUtils.register(new ShortConverter(null), Short.class);
		ConvertUtils.register(new ByteConverter(null), Byte.class);
		ConvertUtils.register(new BigDecimalConverter(null),
				BigDecimal.class);
		ConvertUtils.register(new BigIntegerConverter(null),
				BigInteger.class);
		//Date
		ConvertUtils.register(new SqlTimeConverter(null),
				java.sql.Time.class);
		ConvertUtils.register(new SqlDateConverter(null),
				java.sql.Date.class);
		ConvertUtils.register(new SqlTimestampConverter(null),
				java.sql.Timestamp.class);	
		//Boolean
		ConvertUtils.register(new BooleanConverter(null),
				Boolean.class);
		//String

	}
}
